]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appFavorites: Don't add app explicitly
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 12 Aug 2018 00:17:42 +0000 (02:17 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 8 Oct 2018 16:22:04 +0000 (16:22 +0000)
When adding a favorite, we add the ID to the list of favorites, save the
setting and add the new app to the favorites map. However as writing the
settings value already results in reload() to update the favorites map,
the new app is usually already in the map when we add it.

The only exception is when the ID was found in the RENAMED_DESKTOP_IDS map,
in which case we end up adding both the renamed app and the original one.
Fix this by simply relying on reload() to properly update the map, just like
we already do in _removeFavorite().

https://gitlab.gnome.org/GNOME/gnome-shell/issues/471

js/ui/appFavorites.js

index 8d074cffaeb9b1f8ba84f9eda18a3cd1accb0fe8..9de7070470bf3bef239354ebcaa1c1fc6526a02c 100644 (file)
@@ -128,7 +128,6 @@ var AppFavorites = new Lang.Class({
         else
             ids.splice(pos, 0, appId);
         global.settings.set_strv(this.FAVORITE_APPS_KEY, ids);
-        this._favorites[appId] = app;
         return true;
     },